/*
 * @Description: 处理响应结果
 * @Version: 2.0
 * @Autor: kafei
 * @Date: 2021-11-18 15:45:27
 * @LastEditors: kafei
 * @LastEditTime: 2021-11-19 11:48:54
 */
const result = (code, data) => {
  if (typeof data === 'string') {
    return {
      code,
      message: data
    }
  }

  return {
    code,
    data: data.data,
    message: data.message
  }
}
module.exports = result
